package com.hcms.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hcms.mybatis.entity.SysResource;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * <p>
 * 对象存储记录 服务类
 * </p>
 *
 * @author achenxw@126.com
 * @since 2023-02-23
 */
public interface ISysResourceService extends IService<SysResource> {

    /**
     * 根据path查询一条记录
     */
    SysResource getOneBySha1(String sha1);

    /**
     * 上传文件，保存到数据库中
     */
    SysResource uploadObject(MultipartFile file, Long adminId) throws IOException;


    boolean deleteObject(String url, Long adminId) throws FileNotFoundException;

}
